<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        body{
            height: 1000px;
        }
        /*定位到第一个div元素*/
        div:nth-of-type(1){
            width: 100px;
            height: 100px;
            background: #3748ff;
            position: absolute;/*绝对定位*/
            right: 0;
            bottom: 0;
        }
        /*定位到第二个div元素*/
        div:nth-of-type(2){
            width: 50px;
            height: 50px;
            background: #d4f326;
            position: fixed;/*固定定位*/
            right: 0;
            bottom: 0;
        }


    </style>
</head>
<body>
    <div>
    <p>p1</p>
    <div>div1</div>
    <div>div2</div>
    </div>
</body>
</html>